You are here: Statements and Functions > Last()
Syntax samples
LAST()
Var1=LAST()
IF LAST() = 13 THEN Var3 = 0
IF LAST() = PathNet1.N1 THEN INC Var1
Returns the name-index number of the node from which a resource has just traveled. LAST() can be useful to choose the appropriate graphic or to reset a variable. You can also check the name-index number of the last node by specifying <path network name>. <name of the node>. For example, if you wanted to know if the last node was N5 on the network Net3, you could specify "IF LAST() = Net3.N5 THEN..." in the node entry logic.
Node entry logic.
Example
This Entry Logic window shows that whenever a resource enters a particular node a check is made to see if the name-index number of the last node equals one. If so, the resource graphic is changed to Graphic 2, otherwise it is changed to Graphic 3.
NEXT() and WAIT...UNTIL.